import {reqSongListDetail} from "@/http/api";

export default {
    namespaced: true,//开启命名空间
    state: {
        HotPlaylist:{},
    },
    mutations: {
        GETDJTOPLIST(state,data){
            state.HotPlaylist = data.playlist

            if(state.HotPlaylist.description != null){
                state.HotPlaylist.descDot = data.playlist.description.replace(/\n/g,'<br>').slice(0,(data.playlist.description.length)/2)+'...';
                state.HotPlaylist.descMore = data.playlist.description.replace(/\n/g,'<br>');
            }
        },

    },
    actions: {

        async getDjTopList({commit},id){
            let result = await reqSongListDetail(id);
            if(result.status === 200){
                commit('GETDJTOPLIST',result.data);
            }
        },
    },

    getters: {
    }
}
